﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomerSearch.aspx.cs"
    Inherits="BEGDC.CC.Web.CIS2.Overseas.Search.CustomerSearch" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../../css/global.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/main2.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="mainbox">
        <div class="sitemapbox">
            <div class="sitemap">
                &nbsp;»&nbsp;Search(Overseas)&nbsp;»&nbsp;Customer Search
            </div>
        </div>
         <div class="formbox_dashed">
        </div>
<table width="100%"><tr><td height="30">
                <font style="font-size: 14px;">&nbsp;&raquo;&nbsp;基本信息</font>
</td></tr></table>
        <table width="100%" style="font-size: 12px;">
            <tr height="30">
                <td width="80">
                    &nbsp;&nbsp;客户名称:
                </td>
                <td width="230">
                    <asp:TextBox ID="txtCustomerName" runat="server" CssClass="txtbox" onmouseover="this.className='txtboxover';"
                        onmouseout="this.className='txtbox';"></asp:TextBox>
                </td>
                <td width="80">
                    &nbsp;&nbsp;公司名称:
                </td>
                <td width="230">
                    <asp:TextBox ID="txtCompanyName" runat="server" CssClass="txtbox" onmouseover="this.className='txtboxover';"
                        onmouseout="this.className='txtbox';"></asp:TextBox>
                </td>
                <td width="80">
                    &nbsp;&nbsp;客户职位:
                </td>
                <td width="230">
                    <asp:TextBox ID="txtTitle" runat="server" CssClass="txtbox" onmouseover="this.className='txtboxover';"
                        onmouseout="this.className='txtbox';"></asp:TextBox>
                </td>
            </tr>
            <tr height="30">
                <td width="80">
                    &nbsp;&nbsp;客户等级:
                </td>
                <td width="230">
                    <asp:DropDownList ID="selectlevel" runat="server" Width="130" />
                </td>
                <td width="80">
                    &nbsp;&nbsp;客户定义:
                </td>
                <td width="230">
                    <asp:DropDownList ID="selectDefination" runat="server" Width="130" />
                </td>
                <td width="80">
                    &nbsp;&nbsp;Country:
                </td>
                <td width="230">
                    <asp:DropDownList ID="selectCountry" runat="server" Width="130" />
                </td>
            </tr>
            <tr height="30">
                <td width="80">
                    &nbsp;&nbsp;喜好类型:
                </td>
                <td width="230">
                    <asp:DropDownList ID="PreferenceList" runat="server" Width="130" OnSelectedIndexChanged="PreferenceList_SelectedIndexChanged" />
                </td>
                <td width="80">
                    &nbsp;&nbsp;喜好:
                </td>
                <td width="230">
                    <asp:DropDownList ID="PreferenceValue" runat="server" Width="130" />
                </td>
                <td width="80">
                    &nbsp;&nbsp;喜好值:
                </td>
                <td width="230">
                    <asp:DropDownList ID="PreferenceLevel" runat="server" Width="130" />
                </td>
            </tr>
        </table>
        <div class="formbox_dashed">
        </div>
<table width="100%"><tr><td height="30">
                <font style="font-size: 14px;">&nbsp;&raquo;&nbsp;学习经历</font>
</td></tr></table>
        
        <table width="100%" style="font-size: 12px;">
            <tr height="30">
                <td width="80">
                    &nbsp;&nbsp;学位:
                </td>
                <td width="230">
                    <asp:DropDownList ID="selectDegree" runat="server" Width="130" />
                </td>
                <td width="80">
                    &nbsp;&nbsp;毕业学校:
                </td>
                <td width="230">
                    <asp:TextBox ID="txtSchool" runat="server" CssClass="txtbox" onmouseover="this.className='txtboxover';"
                        onmouseout="this.className='txtbox';"></asp:TextBox>
                </td>
                <td width="80">
                    &nbsp;
                </td>
                <td width="230">
                    &nbsp;
                </td>
            </tr>
        </table>
        <div class="formbox_dashed">
        </div>
<table width="100%"><tr><td height="30">
                <font style="font-size: 14px;">&nbsp;&raquo;&nbsp;工作经历</font>
</td></tr></table>

        <table width="100%" style="font-size: 12px;">
            <tr height="30">
                <td width="80">
                    &nbsp;&nbsp;公司名称:
                </td>
                <td width="230">
                    <asp:TextBox ID="txtOldCompanyName" runat="server" CssClass="txtbox" onmouseover="this.className='txtboxover';"
                        onmouseout="this.className='txtbox';"></asp:TextBox>
                </td>
                <td width="80">
                    &nbsp;&nbsp;职位:
                </td>
                <td width="230">
                    <asp:TextBox ID="txtOldTitle" runat="server" CssClass="txtbox" onmouseover="this.className='txtboxover';"
                        onmouseout="this.className='txtbox';"></asp:TextBox>
                </td>
                <td width="80">
                    &nbsp;&nbsp;编辑人:
                </td>
                <td width="230">
                    <asp:TextBox ID="txtEdit" runat="Server" CssClass="txtbox" onmouseover="this.className='txtboxover';"
                        onmouseout="this.className='txtbox';"></asp:TextBox>
                </td>
            </tr>
        </table>
        <div style="padding: 10px;">
        <asp:Button ID="btnOK" runat="server" Text="查询" OnClick="btnOK_Click" CssClass="btn" />
        <asp:Button ID="btnClear" runat="server" Text="清除" OnClick="btnClear_Click" CssClass="btn" />
        </div>
    </div>
    <div>
        <asp:GridView ID="GVCustomer" runat="server" AutoGenerateColumns="False" DataKeyNames="CustomerID"
            DataSourceID="edsCustomer" Visible="False" OnRowCommand="GVCustomer_RowCommand"
            AllowPaging="true" CssClass="tablestyle" EmptyDataText="There is no data to display!">
            <FooterStyle />
            <RowStyle CssClass="tbody" />
            <PagerStyle CssClass="pagecounting2" HorizontalAlign="right" />
            <SelectedRowStyle />
            <HeaderStyle CssClass="thead" ForeColor="#ffffff" />
            <Columns>
                <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" SortExpression="CustomerID"
                    ReadOnly="True" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:TemplateField HeaderText="Company">
                    <ItemTemplate>
                        <asp:Label ID="Company" runat="server" Text='<%#Eval("Company.Name")%>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Department">
                    <ItemTemplate>
                        <asp:Label ID="Department" runat="server" Text='<%#Eval("CustomerDepartment.Name")%>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                <asp:TemplateField HeaderText="LastModifyBy">
                    <ItemTemplate>
                        <asp:Label ID="LastModifyBy" runat="server" Text='<%#Eval("LastModifyBy.NameEN")%>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:ButtonField CommandName="open" ButtonType="Image" ImageUrl="~/images/book_open.gif" />
            </Columns>
        </asp:GridView>
        <asp:DetailsView ID="DVCustomer" runat="server" AutoGenerateRows="False" DataKeyNames="CustomerID"
            DataSourceID="edsCustomer" DefaultMode="ReadOnly" Visible="false" CssClass="tablestyle2">
            <Fields>
                <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" ReadOnly="True" SortExpression="CustomerID" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:TemplateField HeaderText="Gender">
                    <ItemTemplate>
                        <%#(Eval("Gender")).ToString().Trim()=="True"?"Male":"Female" %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                <asp:TemplateField HeaderText="Level">
                    <ItemTemplate>
                        Level<%#Eval("Level") %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="CellPhone" HeaderText="CellPhone" SortExpression="CellPhone" />
                <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
                <asp:TemplateField HeaderText="Company">
                    <ItemTemplate>
                        <%#Eval("Company.Name")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Department">
                    <ItemTemplate>
                        <%#Eval("CustomerDepartment.Name")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Nationality" HeaderText="Nationality" SortExpression="Nationality" />
                <asp:TemplateField HeaderText="Definition">
                    <ItemTemplate>
                        <%#Eval("Definition.Name") %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
                <asp:TemplateField HeaderText="Education">
                    <ItemTemplate>
                        <asp:Repeater runat="server" DataSource='<%# GetEducations(EvalX("Education")) %>'>
                            <ItemTemplate>
                                毕业学校:<%#Eval("School") %>; 学位:<%#Eval("Degree") %>; 描述:<%#Eval("Description") %><br />
                            </ItemTemplate>
                        </asp:Repeater>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="FamilyInfo">
                    <ItemTemplate>
                        <asp:Repeater runat="server" DataSource='<%# GetFamilyinfos(EvalX("FamilyInfo")) %>'>
                            <ItemTemplate>
                                姓名:<%#Eval("Name") %>; 关系:<%#Eval("Relationship") %>;工作地点:<%#Eval("Workplace") %>;
                                描述:<%#Eval("Description") %><br />
                            </ItemTemplate>
                        </asp:Repeater>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="WorkExperience">
                    <ItemTemplate>
                        <asp:Repeater runat="server" DataSource='<%# GetWorkExperiences(EvalX("WorkExperience")) %>'>
                            <ItemTemplate>
                                公司名称:<%#Eval("CompanyName")%>; 职位:<%#Eval("Title")%>;开始时间:<%#Eval("StartTime")%>;结束时间:<%#Eval("EndTime")%>;
                                描述:<%#Eval("Description") %><br />
                            </ItemTemplate>
                        </asp:Repeater>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="CustomerPreference">
                    <ItemTemplate>
                        <asp:Repeater runat="server" DataSource='<%# GetCustomerPreference(EvalX("CustomerPreference")) %>'>
                            <ItemTemplate>
                                喜好类型:<%#Eval("ListName")%>; 喜好:<%#Eval("ValueName")%>;喜好值:<%#Eval("LevelName")%><br />
                            </ItemTemplate>
                        </asp:Repeater>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Birthday" HeaderText="Birthday" SortExpression="Birthday" />
                <asp:BoundField DataField="CreateTime" HeaderText="CreateTime" SortExpression="CreateTime" />
                <asp:TemplateField HeaderText="CreateBy">
                    <ItemTemplate>
                        <%#Eval("CreateBy.NameEN")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="LastModifyTime" HeaderText="LastModifyTime" SortExpression="LastModifyTime" />
                <asp:TemplateField HeaderText="LastModifyBy">
                    <ItemTemplate>
                        <%#Eval("LastModifyBy.NameEN")%>
                    </ItemTemplate>
                </asp:TemplateField>
            </Fields>
        </asp:DetailsView>
    </div>
    <asp:EntityDataSource ID="edsCustomer" runat="server" ConnectionString="name=CCEntities"
        DefaultContainerName="CCEntities" EnableDelete="True" EnableInsert="True" EnableUpdate="True"
        EntitySetName="Customers" Include="LastModifyBy,Company,CustomerDepartment,Definition,Education,FamilyInfo,WorkExperience,CustomerDepartment,CustomerPreference">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="edsDefinition" runat="server" ConnectionString="name=CCEntities"
        DefaultContainerName="CCEntities" EnableDelete="True" EnableInsert="True" EnableUpdate="True"
        EntitySetName="Definitions" Where="!it.Disabled">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="edsCountry" runat="server" ConnectionString="name=CCEntities"
        DefaultContainerName="CCEntities" EnableDelete="True" EnableInsert="True" EnableUpdate="True"
        EntitySetName="Countries" Where="!it.Disabled">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="edsPreferenceList" runat="server" ConnectionString="name=CCEntities"
        DefaultContainerName="CCEntities" EnableDelete="True" EnableInsert="True" EnableUpdate="True"
        EntitySetName="PreferencesLists" Where="!it.Disabled">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="edsEducation" runat="server" ConnectionString="name=CCEntities"
        DefaultContainerName="CCEntities" EnableDelete="True" EnableInsert="True" EnableUpdate="True"
        EntitySetName="Educations">
    </asp:EntityDataSource>
    </div>
    </form>
</body>
</html>
